<?php
class TagModel extends BaseModel 
{
	protected $_validate = array(
        array('language', 'require', 'language必须!'),
        array('level', 'require', 'level必须!'),
    );

	public function addORupdate($itemid=0, $lang=0, $lev=0, $flag=0) 
	{	
		echo $itemid;
		echo $lang;
		echo $lev;
		
        $data = array();
        $data['itemid'] = $itemid;
        $data['lang'] = $lang;
        $data['lev'] = $lev;
            
        if ($flag) {
            $rs = $this->save($data);
        } else {
            $rs = $this->add($data);
        }

        return $rs;
	}
}